export default [
  { path: '/', name: '主页', icon: 'home', component: './Index' },
  {
    path: '/user',
    layout: false,
    routes: [
      { name: '登录', path: '/user/login', component: './User/Login' },
      { name: '注册', path: '/user/register', component: './User/Register' }
    ],
  },
  {
    path: '/interface_info',
    name: 'API接口页',
    icon: 'dropbox',
    access: 'canUser',
    routes: [
      {
        path: '/interface_info',
        name: 'API接口开放',
        icon: 'plus',
        component: './InterfaceInfoMain'
      },
      {
        path: '/interface_info/:id',
        name: '查看接口',
        icon: 'plus',
        component: './InterfaceInfo',
        hideInMenu: true
      }
    ]
  },
  {
    path: '/chart',
    name: '数据分析页',
    icon: 'lineChart',
    access: 'canUser', // 根据实际权限配置
    routes: [
      {
        path: '/chart',
        redirect: '/chart/add',
        hideInMenu: true
      },
      {
        name: '智能分析',
        icon: 'barChart',
        path: '/chart/add',
        component: './AddChart'
      },
      {
        name: '智能分析（异步）',
        icon: 'barChart',
        path: '/chart/add_async',
        component: './AddChartAsync'
      },
      {
        name: '我的图表',
        icon: 'pieChart',
        path: '/chart/my',
        component: './MyChart'
      }
    ],
  },
  { path: '/add_chart', redirect: '/chart/add' },
  { path: '/add_chart_async', redirect: '/chart/add_async' },
  { path: '/my_chart', redirect: '/chart/my' },
  {
    path: '/generator',
    name: '代码生成器页',
    icon: 'code',
    access: 'canUser',
    routes: [
      {
        path: '/generator',
        redirect: '/generator/search',
        hideInMenu: true
      },
      {
        path: '/generator/search',
        name: '生成器搜索',
        icon: 'plus',
        component: './Generator/Search',
      },
      {
        path: '/generator/add',
        name: '创建生成器',
        icon: 'plus',
        component: './Generator/Add'
      },
      {
        path: '/generator/update',
        name: '修改生成器',
        component: './Generator/Add',
        hideInMenu: true
      },
      {
        path: '/generator/use/:id',
        name: '使用生成器',
        component: './Generator/Use',
        hideInMenu: true,
      },
      {
        path: '/generator/detail/:id',
        name: '生成器详情',
        component: './Generator/Detail',
        hideInMenu: true
      }
    ]
  },
  {
    path: '/test/file',
    icon: 'home',
    component: './Test/File',
    name: '文件上传下载测试',
    hideInMenu: true,
  },
  {
    path: '/admin',
    name: '管理页',
    icon: 'crown',
    access: 'canAdmin',
    routes: [
      { name: '接口管理', icon: 'table', path: '/admin/interface_info', component: './Admin/InterfaceInfo' },
      { name: '接口分析', icon: 'analysis', path: '/admin/interface_analysis', component: './Admin/InterfaceAnalysis' },
      { name: '用户管理', icon: 'user', path: '/admin/user', component: './Admin/User' },
      { name: '生成器管理', icon: 'tools',path: '/admin/generator', component: './Admin/Generator'},
    ],
  },

  // { path: '/', redirect: '/welcome' },
  { path: '*', layout: false, component: './404' },
];